﻿using System;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;

namespace ForumsBrowser.BusinessObjects
{
    public class Message
    {
        public Guid Id { get; set; }
        public bool Root { get; set; }
        public int HelpfulVotes { get; set; }
        public bool HasCode { get; set; }
        public bool Abusive { get; set; }
        public DateTime CreatedOn { get; set; }
        public string Url { get; set; }
        public bool Answer { get; set; }
        public string Status { get; set; }
        public bool Deleted { get; set; }
        public string Subject { get; set; }
        public User Author { get; set; }
        public string Body { get; set; }

        public string CleanedBody { get { return HttpUtility.HtmlDecode(Regex.Replace(Body.Replace("<br/>", Environment.NewLine), "<.+?>", string.Empty)); } }
    }
}
